package com.molichuxing.services.infrastructure.dao;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.framework.dto.TabDto;
import com.molichuxing.services.infrastructure.bean.DeviceBean;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 经销商安装的设备表 Mapper 接口
 * </p>
 *
 * @author zph
 * @since 2019-08-12
 */
public interface DeviceMapper extends RootMapper<DeviceBean> {


    /**
     * 根据id查询设备信息
     *
     * @param ids
     * @return
     */
    List<DeviceBean> selectBatchByIds(@Param("ids") List<Integer> ids);


    /**
     * 根据cpu获取设备信息
     *
     * @param cpus
     * @return
     */
    List<DeviceBean> selectListByCpus(@Param("cpus") List<String> cpus);

    /**
     * 根据cpu获取设备
     *
     * @param cpu
     * @return
     */
    DeviceBean getByCpu(@Param("cpu") String cpu);


    /**
     * 修改设备的信息
     *
     * @param deviceBean
     * @return
     */
    Integer modifyDevice(DeviceBean deviceBean);

    /**
     * 根据条件分页查询count
     *
     * @param params
     * @return
     */
    long getPageCount(@Param("params") Map<String, Object> params);

    /**
     * 根据条件分页查询
     *
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<DeviceBean> getPage(@Param("params") Map<String, Object> params, @Param("pageNum") int pageNum,
                             @Param("pageSize") int pageSize);

    /**
     * 获取总和
     *
     * @return
     */
    int getCount(@Param("deviceIdList") List<Integer> deviceIdList, @Param("startHeartTime") LocalDateTime startHeartTime, @Param("endHeartTime") LocalDateTime endHeartTime);

}
